package cn.iocoder.yudao.module.shop.enums;


import cn.hutool.core.util.EnumUtil;
import cn.iocoder.yudao.module.shop.enums.store.StoreBizTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 礼物卡项目类型
 *
 * @author 曹建伟
 */
@AllArgsConstructor
@Getter
public enum GiftCardTypeEnum {
    TIMES(0, "项目次数"),
    GOODS (1, "物品"),
    MONEY (2, "金额"),
    ;
    /**
     * 类型
     */
    private final Integer type;
    /**
     * 名字
     */
    private final String name;

    public static GiftCardTypeEnum getByType(Integer type) {
        return EnumUtil.getBy(GiftCardTypeEnum.class,
                e -> Objects.equals(type, e.getType()));
    }
}
